
<% if( !@cart.nil? && !@cart.cart_items.empty?) %>	
	
	<div id="entryheadline">
		<h1>Your Shopping Cart</h1>
	</div>
		<table>
			<tr class="header">
				<th>Qty.</th>
				<th>Article</th>
				<th>Price €</th>
				<th></th>
			</tr>
			<%# render partials.  by passing a collection, it will render each of them, as if %>
			<%# this were a for loop. The :as is not necessary, because rails will look at the collection%>
			<%# and see cart_items, and know that singular is cart_item.  I put it here to make it clear. %>
				<%= render(:partial => "cart_item", :collection => @cart.cart_items, :as => :cart_item)%>
		</table>
		
		<hr class="cart"/>
		<div id = "total_price">
			Total = <span class="price"><%= number_to_euro(@cart.total_price) %></span>
		</div>
		<%= clear_floats %>
		<hr class="cart"/>
		<%= button_to "Checkout", {:action => 'checkout'}, {:class => 'cart_button'} %>
		<%= clear_floats %>
		<%= button_to "Empty Cart", {:action => 'empty_cart'}, {:class => 'cart_button'} %>
		<%= clear_floats %>
<% end %>
		
